﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using BillingSystem.DataSetMainTableAdapters;

namespace BillingSystem
{
    class FormMainController
    {
        FormMain formMain;

        DataSetMain dataSetMain = new DataSetMain();        

        BindingSource clientsBindingSource;
        BindingSource numbersBindingSource;

        NUMBERSTableAdapter numbersTableAdapter = new NUMBERSTableAdapter();
        CLIENTSTableAdapter clientsTableAdapter = new CLIENTSTableAdapter();

        public FormMainController(FormMain formMain)
        {
            this.formMain = formMain; 
            
            dataSetMain.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;   
            
            clientsTableAdapter.ClearBeforeFill = true;
            numbersTableAdapter.ClearBeforeFill = true;
            clientsTableAdapter.Fill(this.dataSetMain.CLIENTS);            
            numbersTableAdapter.Fill(this.dataSetMain.NUMBERS);

            clientsBindingSource = new BindingSource(dataSetMain, "CLIENTS");
            numbersBindingSource = new BindingSource(dataSetMain, "NUMBERS");

            //this.formMain.SetControls(clientsBindingSource);      
        }
    }
}
